import request from '@/utils/http/request'

export interface SpuResponse {
  records: SpuModel[],
  total: number,
  size: number,
  current: number,
  searchCount: boolean,
  pages: number
}

export interface SpuModel {
  id: number,
  spuName: string,
  description: string,
  category3Id: number,
  tmId: number,
  spuSaleAttrList: null,
  spuImageList: null
}

export const getSpuList = (page: number, limit: number, category3Id: number) => {
  return request.get<any, SpuResponse>(`/admin/product/${page}/${limit}?category3Id=${category3Id}`)
}

export const deleteSpu = (spuId: number) => {
  return request.delete<any, null>(`/admin/product/deleteSpu/${spuId}`)
}